package com.beijing.springbootclustersession.controller;

import com.beijing.springbootclustersession.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @Authther: mrwu
 * @date:2021/4/2-04
 * @Description:com.beijing.springbootclustersession.controller
 */
@Controller
public class SucessController {
    @RequestMapping("/sucess")
    public String sucess(HttpSession session, Model model){
        String user =(String) session.getAttribute("user");
        User user1 = new User();
        user1.setName(user);
        model.addAttribute("user", user1);
        return "sucess";
    }
}
